package nastani.mk;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class NastaniMKActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
       
   
        ListView list = (ListView) findViewById(R.id.MyListView);  
        
     
        ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();  
        for(int i=0;i<30;i++)  
        {  
            HashMap<String, String> map = new HashMap<String, String>();  
            map.put("ItemTitle", "This is Title.....");  
            map.put("ItemText", "This is text.....");  
            mylist.add(map);  
        }  
        
        SimpleAdapter mSchedule = new SimpleAdapter(this,   
                                                    mylist,
                                                    R.layout.mylist,  
                                                      
                                                              
                                                    new String[] {"ItemTitle", "ItemText"},   
                                                      
                                                      
                                                    new int[] {R.id.ItemTitle,R.id.ItemText});  
       
        list.setAdapter(mSchedule);  

        Button next = (Button) findViewById(R.id.BtnDodadi);
        next.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), Prebaraj.class);
                startActivityForResult(myIntent, 0);
            }

        });
    }   
}